package com.ffggffgfv.backend.dto;

import java.util.Date;

/**
 * 订单查询数据传输对象
 */
public class OrderQueryDTO {

    private Long userId;         // 用户ID
    private String orderNo;      // 订单编号
    private Integer status;      // 订单状态
    private Date startTime;      // 起始时间
    private Date endTime;        // 结束时间
    private Integer pageNum;     // 页码
    private Integer pageSize;    // 每页数量

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Integer getPageNum() {
        return pageNum == null || pageNum < 1 ? 1 : pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize == null || pageSize < 1 ? 10 : (pageSize > 100 ? 100 : pageSize);
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }
}
